<!-- HTML header for doxygen 1.8.6-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<title>OpenCV: cv::NAryMatIterator Class Reference</title>
<link href="../../opencv.ico" rel="shortcut icon" type="image/x-icon" />
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<script type="text/javascript" src="../../tutorial-utils.js"></script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/searchdata.js"></script>
<script type="text/javascript" src="../../search/search.js"></script>
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    extensions: ["tex2jax.js", "TeX/AMSmath.js", "TeX/AMSsymbols.js"],
    jax: ["input/TeX","output/HTML-CSS"],
});
//<![CDATA[
MathJax.Hub.Config(
{
  TeX: {
      Macros: {
          matTT: [ "\\[ \\left|\\begin{array}{ccc} #1 & #2 & #3\\\\ #4 & #5 & #6\\\\ #7 & #8 & #9 \\end{array}\\right| \\]", 9],
          fork: ["\\left\\{ \\begin{array}{l l} #1 & \\mbox{#2}\\\\ #3 & \\mbox{#4}\\\\ \\end{array} \\right.", 4],
          forkthree: ["\\left\\{ \\begin{array}{l l} #1 & \\mbox{#2}\\\\ #3 & \\mbox{#4}\\\\ #5 & \\mbox{#6}\\\\ \\end{array} \\right.", 6],
          forkfour: ["\\left\\{ \\begin{array}{l l} #1 & \\mbox{#2}\\\\ #3 & \\mbox{#4}\\\\ #5 & \\mbox{#6}\\\\ #7 & \\mbox{#8}\\\\ \\end{array} \\right.", 8],
          vecthree: ["\\begin{bmatrix} #1\\\\ #2\\\\ #3 \\end{bmatrix}", 3],
          vecthreethree: ["\\begin{bmatrix} #1 & #2 & #3\\\\ #4 & #5 & #6\\\\ #7 & #8 & #9 \\end{bmatrix}", 9],
          cameramatrix: ["#1 = \\begin{bmatrix} f_x & 0 & c_x\\\\ 0 & f_y & c_y\\\\ 0 & 0 & 1 \\end{bmatrix}", 1],
          distcoeffs: ["(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6 [, s_1, s_2, s_3, s_4[, \\tau_x, \\tau_y]]]]) \\text{ of 4, 5, 8, 12 or 14 elements}"],
          distcoeffsfisheye: ["(k_1, k_2, k_3, k_4)"],
          hdotsfor: ["\\dots", 1],
          mathbbm: ["\\mathbb{#1}", 1],
          bordermatrix: ["\\matrix{#1}", 1]
      }
  }
}
);
//]]>
</script><script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js"></script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
<link href="../../stylesheet.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<!--#include virtual="/google-search.html"-->
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="../../opencv-logo-small.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">OpenCV
   &#160;<span id="projectnumber">4.5.2</span>
   </div>
   <div id="projectbrief">Open Source Computer Vision</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "../../search",false,'Search');
</script>
<script type="text/javascript" src="../../menudata.js"></script>
<script type="text/javascript" src="../../menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('../../',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="../../d2/d75/namespacecv.html">cv</a></li><li class="navelem"><a class="el" href="../../d5/dd2/classcv_1_1NAryMatIterator.html">NAryMatIterator</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-attribs">Public Attributes</a> &#124;
<a href="#pro-attribs">Protected Attributes</a> &#124;
<a href="../../da/df8/classcv_1_1NAryMatIterator-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">cv::NAryMatIterator Class Reference<div class="ingroups"><a class="el" href="../../d0/de1/group__core.html">Core functionality</a> &raquo; <a class="el" href="../../dc/d84/group__core__basic.html">Basic structures</a></div></div>  </div>
</div><!--header-->
<div class="contents">

<p>n-ary multi-dimensional array iterator.  
 <a href="../../d5/dd2/classcv_1_1NAryMatIterator.html#details">More...</a></p>

<p><code>#include &lt;opencv2/core/mat.hpp&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:ade2ae0a6205c67696666441ea85d1eea"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d5/dd2/classcv_1_1NAryMatIterator.html#ade2ae0a6205c67696666441ea85d1eea">NAryMatIterator</a> ()</td></tr>
<tr class="memdesc:ade2ae0a6205c67696666441ea85d1eea"><td class="mdescLeft">&#160;</td><td class="mdescRight">the default constructor  <a href="#ade2ae0a6205c67696666441ea85d1eea">More...</a><br /></td></tr>
<tr class="separator:ade2ae0a6205c67696666441ea85d1eea"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa0a0a7e2c68c1de614e73c7fcaa63f2f"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d5/dd2/classcv_1_1NAryMatIterator.html#aa0a0a7e2c68c1de614e73c7fcaa63f2f">NAryMatIterator</a> (const <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> **<a class="el" href="../../d5/dd2/classcv_1_1NAryMatIterator.html#a001ac5692124eefacd223ab4c26a430f">arrays</a>, <a class="el" href="../../d1/d1b/group__core__hal__interface.html#ga65f85814a8290f9797005d3b28e7e5fc">uchar</a> **<a class="el" href="../../d5/dd2/classcv_1_1NAryMatIterator.html#ab7c6aeaca3c95077786f894a549f48eb">ptrs</a>, int <a class="el" href="../../d5/dd2/classcv_1_1NAryMatIterator.html#aefb7ee05b467bfd4623b5a85bfb81066">narrays</a>=-1)</td></tr>
<tr class="memdesc:aa0a0a7e2c68c1de614e73c7fcaa63f2f"><td class="mdescLeft">&#160;</td><td class="mdescRight">the full constructor taking arbitrary number of n-dim matrices  <a href="#aa0a0a7e2c68c1de614e73c7fcaa63f2f">More...</a><br /></td></tr>
<tr class="separator:aa0a0a7e2c68c1de614e73c7fcaa63f2f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acbc0100414fe60ab212553a67dd788b6"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d5/dd2/classcv_1_1NAryMatIterator.html#acbc0100414fe60ab212553a67dd788b6">NAryMatIterator</a> (const <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> **<a class="el" href="../../d5/dd2/classcv_1_1NAryMatIterator.html#a001ac5692124eefacd223ab4c26a430f">arrays</a>, <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> *<a class="el" href="../../d5/dd2/classcv_1_1NAryMatIterator.html#add8eb6b9303aeed6dccd8a57809b6260">planes</a>, int <a class="el" href="../../d5/dd2/classcv_1_1NAryMatIterator.html#aefb7ee05b467bfd4623b5a85bfb81066">narrays</a>=-1)</td></tr>
<tr class="memdesc:acbc0100414fe60ab212553a67dd788b6"><td class="mdescLeft">&#160;</td><td class="mdescRight">the full constructor taking arbitrary number of n-dim matrices  <a href="#acbc0100414fe60ab212553a67dd788b6">More...</a><br /></td></tr>
<tr class="separator:acbc0100414fe60ab212553a67dd788b6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acbe9be31cecb11ea14fcf4b0fafe6f3d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d5/dd2/classcv_1_1NAryMatIterator.html#acbe9be31cecb11ea14fcf4b0fafe6f3d">init</a> (const <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> **<a class="el" href="../../d5/dd2/classcv_1_1NAryMatIterator.html#a001ac5692124eefacd223ab4c26a430f">arrays</a>, <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> *<a class="el" href="../../d5/dd2/classcv_1_1NAryMatIterator.html#add8eb6b9303aeed6dccd8a57809b6260">planes</a>, <a class="el" href="../../d1/d1b/group__core__hal__interface.html#ga65f85814a8290f9797005d3b28e7e5fc">uchar</a> **<a class="el" href="../../d5/dd2/classcv_1_1NAryMatIterator.html#ab7c6aeaca3c95077786f894a549f48eb">ptrs</a>, int <a class="el" href="../../d5/dd2/classcv_1_1NAryMatIterator.html#aefb7ee05b467bfd4623b5a85bfb81066">narrays</a>=-1)</td></tr>
<tr class="memdesc:acbe9be31cecb11ea14fcf4b0fafe6f3d"><td class="mdescLeft">&#160;</td><td class="mdescRight">the separate iterator initialization method  <a href="#acbe9be31cecb11ea14fcf4b0fafe6f3d">More...</a><br /></td></tr>
<tr class="separator:acbe9be31cecb11ea14fcf4b0fafe6f3d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3e686d47da475b75c9b8ec11723bb2f3"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../d5/dd2/classcv_1_1NAryMatIterator.html">NAryMatIterator</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d5/dd2/classcv_1_1NAryMatIterator.html#a3e686d47da475b75c9b8ec11723bb2f3">operator++</a> ()</td></tr>
<tr class="memdesc:a3e686d47da475b75c9b8ec11723bb2f3"><td class="mdescLeft">&#160;</td><td class="mdescRight">proceeds to the next plane of every iterated matrix  <a href="#a3e686d47da475b75c9b8ec11723bb2f3">More...</a><br /></td></tr>
<tr class="separator:a3e686d47da475b75c9b8ec11723bb2f3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a260701f031521ebeac69bcc35c02a0d9"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../d5/dd2/classcv_1_1NAryMatIterator.html">NAryMatIterator</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d5/dd2/classcv_1_1NAryMatIterator.html#a260701f031521ebeac69bcc35c02a0d9">operator++</a> (int)</td></tr>
<tr class="memdesc:a260701f031521ebeac69bcc35c02a0d9"><td class="mdescLeft">&#160;</td><td class="mdescRight">proceeds to the next plane of every iterated matrix (postfix increment operator)  <a href="#a260701f031521ebeac69bcc35c02a0d9">More...</a><br /></td></tr>
<tr class="separator:a260701f031521ebeac69bcc35c02a0d9"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
Public Attributes</h2></td></tr>
<tr class="memitem:a001ac5692124eefacd223ab4c26a430f"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> **&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d5/dd2/classcv_1_1NAryMatIterator.html#a001ac5692124eefacd223ab4c26a430f">arrays</a></td></tr>
<tr class="memdesc:a001ac5692124eefacd223ab4c26a430f"><td class="mdescLeft">&#160;</td><td class="mdescRight">the iterated arrays  <a href="#a001ac5692124eefacd223ab4c26a430f">More...</a><br /></td></tr>
<tr class="separator:a001ac5692124eefacd223ab4c26a430f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aefb7ee05b467bfd4623b5a85bfb81066"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d5/dd2/classcv_1_1NAryMatIterator.html#aefb7ee05b467bfd4623b5a85bfb81066">narrays</a></td></tr>
<tr class="memdesc:aefb7ee05b467bfd4623b5a85bfb81066"><td class="mdescLeft">&#160;</td><td class="mdescRight">the number of arrays  <a href="#aefb7ee05b467bfd4623b5a85bfb81066">More...</a><br /></td></tr>
<tr class="separator:aefb7ee05b467bfd4623b5a85bfb81066"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a94ba374a7e5a004d19060a522893e09d"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d5/dd2/classcv_1_1NAryMatIterator.html#a94ba374a7e5a004d19060a522893e09d">nplanes</a></td></tr>
<tr class="memdesc:a94ba374a7e5a004d19060a522893e09d"><td class="mdescLeft">&#160;</td><td class="mdescRight">the number of hyper-planes that the iterator steps through  <a href="#a94ba374a7e5a004d19060a522893e09d">More...</a><br /></td></tr>
<tr class="separator:a94ba374a7e5a004d19060a522893e09d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:add8eb6b9303aeed6dccd8a57809b6260"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d5/dd2/classcv_1_1NAryMatIterator.html#add8eb6b9303aeed6dccd8a57809b6260">planes</a></td></tr>
<tr class="memdesc:add8eb6b9303aeed6dccd8a57809b6260"><td class="mdescLeft">&#160;</td><td class="mdescRight">the current planes  <a href="#add8eb6b9303aeed6dccd8a57809b6260">More...</a><br /></td></tr>
<tr class="separator:add8eb6b9303aeed6dccd8a57809b6260"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab7c6aeaca3c95077786f894a549f48eb"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../d1/d1b/group__core__hal__interface.html#ga65f85814a8290f9797005d3b28e7e5fc">uchar</a> **&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d5/dd2/classcv_1_1NAryMatIterator.html#ab7c6aeaca3c95077786f894a549f48eb">ptrs</a></td></tr>
<tr class="memdesc:ab7c6aeaca3c95077786f894a549f48eb"><td class="mdescLeft">&#160;</td><td class="mdescRight">data pointers  <a href="#ab7c6aeaca3c95077786f894a549f48eb">More...</a><br /></td></tr>
<tr class="separator:ab7c6aeaca3c95077786f894a549f48eb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a42ec820537c8749494a65784dbb44261"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d5/dd2/classcv_1_1NAryMatIterator.html#a42ec820537c8749494a65784dbb44261">size</a></td></tr>
<tr class="memdesc:a42ec820537c8749494a65784dbb44261"><td class="mdescLeft">&#160;</td><td class="mdescRight">the size of each segment (in elements)  <a href="#a42ec820537c8749494a65784dbb44261">More...</a><br /></td></tr>
<tr class="separator:a42ec820537c8749494a65784dbb44261"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-attribs"></a>
Protected Attributes</h2></td></tr>
<tr class="memitem:a81dead7447791c3ca2833aebce555bca"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d5/dd2/classcv_1_1NAryMatIterator.html#a81dead7447791c3ca2833aebce555bca">idx</a></td></tr>
<tr class="separator:a81dead7447791c3ca2833aebce555bca"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a12f058bd6c7ea7e2b87c65eaa3054e0e"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d5/dd2/classcv_1_1NAryMatIterator.html#a12f058bd6c7ea7e2b87c65eaa3054e0e">iterdepth</a></td></tr>
<tr class="separator:a12f058bd6c7ea7e2b87c65eaa3054e0e"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>n-ary multi-dimensional array iterator. </p>
<p>Use the class to implement unary, binary, and, generally, n-ary element-wise operations on multi-dimensional arrays. Some of the arguments of an n-ary function may be continuous arrays, some may be not. It is possible to use conventional MatIterator 's for each array but incrementing all of the iterators after each small operations may be a big overhead. In this case consider using <a class="el" href="../../d5/dd2/classcv_1_1NAryMatIterator.html" title="n-ary multi-dimensional array iterator. ">NAryMatIterator</a> to iterate through several matrices simultaneously as long as they have the same geometry (dimensionality and all the dimension sizes are the same). On each iteration <code>it.planes[0]</code>, <code>it.planes[1]</code>,... will be the slices of the corresponding matrices.</p>
<p>The example below illustrates how you can compute a normalized and threshold 3D color histogram: </p><div class="fragment"><div class="line"><span class="keywordtype">void</span> computeNormalizedColorHist(<span class="keyword">const</span> Mat&amp; image, Mat&amp; hist, <span class="keywordtype">int</span> N, <span class="keywordtype">double</span> minProb)</div><div class="line">{</div><div class="line">    <span class="keyword">const</span> <span class="keywordtype">int</span> histSize[] = {N, N, N};</div><div class="line"></div><div class="line">    <span class="comment">// make sure that the histogram has a proper size and type</span></div><div class="line">    hist.create(3, histSize, <a class="code" href="../../d1/d1b/group__core__hal__interface.html#ga4a3def5d72b74bed31f5f8ab7676099c">CV_32F</a>);</div><div class="line"></div><div class="line">    <span class="comment">// and clear it</span></div><div class="line">    hist = <a class="code" href="../../dc/d84/group__core__basic.html#ga599fe92e910c027be274233eccad7beb">Scalar</a>(0);</div><div class="line"></div><div class="line">    <span class="comment">// the loop below assumes that the image</span></div><div class="line">    <span class="comment">// is a 8-bit 3-channel. check it.</span></div><div class="line">    <a class="code" href="../../db/de0/group__core__utils.html#gaf62bcd90f70e275191ab95136d85906b">CV_Assert</a>(image.type() == <a class="code" href="../../d1/d1b/group__core__hal__interface.html#ga88c4cd9de76f678f33928ef1e3f96047">CV_8UC3</a>);</div><div class="line">    MatConstIterator_&lt;Vec3b&gt; it = image.begin&lt;<a class="code" href="../../dc/d84/group__core__basic.html#ga7e6060c0b8d48459964df6e1eb524c03">Vec3b</a>&gt;(),</div><div class="line">                             it_end = image.end&lt;<a class="code" href="../../dc/d84/group__core__basic.html#ga7e6060c0b8d48459964df6e1eb524c03">Vec3b</a>&gt;();</div><div class="line">    <span class="keywordflow">for</span>( ; it != it_end; ++it )</div><div class="line">    {</div><div class="line">        <span class="keyword">const</span> <a class="code" href="../../dc/d84/group__core__basic.html#ga7e6060c0b8d48459964df6e1eb524c03">Vec3b</a>&amp; pix = *it;</div><div class="line">        hist.at&lt;<span class="keywordtype">float</span>&gt;(pix[0]*N/256, pix[1]*N/256, pix[2]*N/256) += 1.f;</div><div class="line">    }</div><div class="line"></div><div class="line">    minProb *= image.rows*image.cols;</div><div class="line"></div><div class="line">    <span class="comment">// initialize iterator (the style is different from STL).</span></div><div class="line">    <span class="comment">// after initialization the iterator will contain</span></div><div class="line">    <span class="comment">// the number of slices or planes the iterator will go through.</span></div><div class="line">    <span class="comment">// it simultaneously increments iterators for several matrices</span></div><div class="line">    <span class="comment">// supplied as a null terminated list of pointers</span></div><div class="line">    <span class="keyword">const</span> Mat* <a class="code" href="../../d5/dd2/classcv_1_1NAryMatIterator.html#a001ac5692124eefacd223ab4c26a430f">arrays</a>[] = {&amp;hist, 0};</div><div class="line">    Mat <a class="code" href="../../d5/dd2/classcv_1_1NAryMatIterator.html#add8eb6b9303aeed6dccd8a57809b6260">planes</a>[1];</div><div class="line">    <a class="code" href="../../d5/dd2/classcv_1_1NAryMatIterator.html#ade2ae0a6205c67696666441ea85d1eea">NAryMatIterator</a> itNAry(arrays, planes, 1);</div><div class="line">    <span class="keywordtype">double</span> s = 0;</div><div class="line">    <span class="comment">// iterate through the matrix. on each iteration</span></div><div class="line">    <span class="comment">// itNAry.planes[i] (of type Mat) will be set to the current plane</span></div><div class="line">    <span class="comment">// of the i-th n-dim matrix passed to the iterator constructor.</span></div><div class="line">    <span class="keywordflow">for</span>(<span class="keywordtype">int</span> p = 0; p &lt; itNAry.nplanes; p++, ++itNAry)</div><div class="line">    {</div><div class="line">        <a class="code" href="../../d7/d1b/group__imgproc__misc.html#gae8a4a146d1ca78c626a53577199e9c57">threshold</a>(itNAry.planes[0], itNAry.planes[0], minProb, 0, <a class="code" href="../../d7/d1b/group__imgproc__misc.html#ggaa9e58d2860d4afa658ef70a9b1115576a0e50a338a4b711a8c48f06a6b105dd98">THRESH_TOZERO</a>);</div><div class="line">        s += <a class="code" href="../../d2/de8/group__core__array.html#ga716e10a2dd9e228e4d3c95818f106722">sum</a>(itNAry.planes[0])[0];</div><div class="line">    }</div><div class="line"></div><div class="line">    s = 1./s;</div><div class="line">    itNAry = <a class="code" href="../../d5/dd2/classcv_1_1NAryMatIterator.html#ade2ae0a6205c67696666441ea85d1eea">NAryMatIterator</a>(arrays, planes, 1);</div><div class="line">    <span class="keywordflow">for</span>(<span class="keywordtype">int</span> p = 0; p &lt; itNAry.nplanes; p++, ++itNAry)</div><div class="line">        itNAry.planes[0] *= s;</div><div class="line">}</div></div><!-- fragment --> </div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="ade2ae0a6205c67696666441ea85d1eea"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ade2ae0a6205c67696666441ea85d1eea">&#9670;&nbsp;</a></span>NAryMatIterator() <span class="overload">[1/3]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">cv::NAryMatIterator::NAryMatIterator </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>the default constructor </p>

</div>
</div>
<a id="aa0a0a7e2c68c1de614e73c7fcaa63f2f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa0a0a7e2c68c1de614e73c7fcaa63f2f">&#9670;&nbsp;</a></span>NAryMatIterator() <span class="overload">[2/3]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">cv::NAryMatIterator::NAryMatIterator </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> **&#160;</td>
          <td class="paramname"><em>arrays</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../d1/d1b/group__core__hal__interface.html#ga65f85814a8290f9797005d3b28e7e5fc">uchar</a> **&#160;</td>
          <td class="paramname"><em>ptrs</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>narrays</em> = <code>-1</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>the full constructor taking arbitrary number of n-dim matrices </p>

</div>
</div>
<a id="acbc0100414fe60ab212553a67dd788b6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acbc0100414fe60ab212553a67dd788b6">&#9670;&nbsp;</a></span>NAryMatIterator() <span class="overload">[3/3]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">cv::NAryMatIterator::NAryMatIterator </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> **&#160;</td>
          <td class="paramname"><em>arrays</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> *&#160;</td>
          <td class="paramname"><em>planes</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>narrays</em> = <code>-1</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>the full constructor taking arbitrary number of n-dim matrices </p>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="acbe9be31cecb11ea14fcf4b0fafe6f3d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acbe9be31cecb11ea14fcf4b0fafe6f3d">&#9670;&nbsp;</a></span>init()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cv::NAryMatIterator::init </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> **&#160;</td>
          <td class="paramname"><em>arrays</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a> *&#160;</td>
          <td class="paramname"><em>planes</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../d1/d1b/group__core__hal__interface.html#ga65f85814a8290f9797005d3b28e7e5fc">uchar</a> **&#160;</td>
          <td class="paramname"><em>ptrs</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>narrays</em> = <code>-1</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>the separate iterator initialization method </p>

</div>
</div>
<a id="a3e686d47da475b75c9b8ec11723bb2f3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3e686d47da475b75c9b8ec11723bb2f3">&#9670;&nbsp;</a></span>operator++() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../d5/dd2/classcv_1_1NAryMatIterator.html">NAryMatIterator</a>&amp; cv::NAryMatIterator::operator++ </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>proceeds to the next plane of every iterated matrix </p>

</div>
</div>
<a id="a260701f031521ebeac69bcc35c02a0d9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a260701f031521ebeac69bcc35c02a0d9">&#9670;&nbsp;</a></span>operator++() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../d5/dd2/classcv_1_1NAryMatIterator.html">NAryMatIterator</a> cv::NAryMatIterator::operator++ </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>proceeds to the next plane of every iterated matrix (postfix increment operator) </p>

</div>
</div>
<h2 class="groupheader">Member Data Documentation</h2>
<a id="a001ac5692124eefacd223ab4c26a430f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a001ac5692124eefacd223ab4c26a430f">&#9670;&nbsp;</a></span>arrays</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a>** cv::NAryMatIterator::arrays</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>the iterated arrays </p>

</div>
</div>
<a id="a81dead7447791c3ca2833aebce555bca"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a81dead7447791c3ca2833aebce555bca">&#9670;&nbsp;</a></span>idx</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">size_t cv::NAryMatIterator::idx</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

</div>
</div>
<a id="a12f058bd6c7ea7e2b87c65eaa3054e0e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a12f058bd6c7ea7e2b87c65eaa3054e0e">&#9670;&nbsp;</a></span>iterdepth</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">int cv::NAryMatIterator::iterdepth</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

</div>
</div>
<a id="aefb7ee05b467bfd4623b5a85bfb81066"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aefb7ee05b467bfd4623b5a85bfb81066">&#9670;&nbsp;</a></span>narrays</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int cv::NAryMatIterator::narrays</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>the number of arrays </p>

</div>
</div>
<a id="a94ba374a7e5a004d19060a522893e09d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a94ba374a7e5a004d19060a522893e09d">&#9670;&nbsp;</a></span>nplanes</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">size_t cv::NAryMatIterator::nplanes</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>the number of hyper-planes that the iterator steps through </p>

</div>
</div>
<a id="add8eb6b9303aeed6dccd8a57809b6260"></a>
<h2 class="memtitle"><span class="permalink"><a href="#add8eb6b9303aeed6dccd8a57809b6260">&#9670;&nbsp;</a></span>planes</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../d3/d63/classcv_1_1Mat.html">Mat</a>* cv::NAryMatIterator::planes</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>the current planes </p>

</div>
</div>
<a id="ab7c6aeaca3c95077786f894a549f48eb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab7c6aeaca3c95077786f894a549f48eb">&#9670;&nbsp;</a></span>ptrs</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="../../d1/d1b/group__core__hal__interface.html#ga65f85814a8290f9797005d3b28e7e5fc">uchar</a>** cv::NAryMatIterator::ptrs</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>data pointers </p>

</div>
</div>
<a id="a42ec820537c8749494a65784dbb44261"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a42ec820537c8749494a65784dbb44261">&#9670;&nbsp;</a></span>size</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">size_t cv::NAryMatIterator::size</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>the size of each segment (in elements) </p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>opencv2/core/<a class="el" href="../../d3/d82/core_2include_2opencv2_2core_2mat_8hpp.html">mat.hpp</a></li>
</ul>
</div><!-- contents -->
<!-- HTML footer for doxygen 1.8.6-->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Fri Apr 2 2021 11:36:43 for OpenCV by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="../../doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
<script type="text/javascript">
//<![CDATA[
addTutorialsButtons();
//]]>
</script>
</body>
</html>
